From: Sam Reed Date: Mon, 19 Sep 2011 13:47:15 +0000 (+0000) Subject: Fix assingment in conditionals X-Git-Tag: 1.31.0-rc.0~27562 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=102e98d6b284be4b90d27eb01ab5315d9659ab32;p=lhc%2Fweb%2Fwiklou.git Fix assingment in conditionals Remove unused globals/variables --- diff --git a/languages/Language.php b/languages/Language.php index 8e7cc65a1a..ca9782d7a0 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -514,7 +514,6 @@ class Language { return $this->mNamespaceIds; } - /** * Get a namespace key by value, case insensitive. Canonical namespace * names override custom ones defined for the current language. @@ -524,7 +523,8 @@ class Language { */ function getNsIndex( $text ) { $lctext = $this->lc( $text ); - if ( ( $ns = MWNamespace::getCanonicalIndex( $lctext ) ) !== null ) { + $ns = MWNamespace::getCanonicalIndex( $lctext ); + if ( $ns !== null ) { return $ns; } $ids = $this->getNamespaceIds(); @@ -543,7 +543,9 @@ class Language { list( $rootCode ) = explode( '-', $code ); if( $usemsg && wfMessage( $msg )->exists() ) { return $this->getMessageFromDB( $msg ); - } elseif( $name = self::getLanguageName( $code ) ) { + } + $name = self::getLanguageName( $code ); + if( $name ) { return $name; # if it's defined as a language name, show that } else { # otherwise, output the language code